import java.sql.SQLOutput;

class Animal{
    public String name;
    public int age;
    public String color;

    public Animal() {
    }

    public Animal(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public void eat(){
        System.out.println(this.name + "吃");
    }
}

class Bird extends Animal{

    public Bird(String name, int age, String color) {
        super(name, age, color);//当父类中存在构造方法时，子类用super(参数)调用父类的构造方法

        this.name = name; //子类构造对象时需调用父类的构造方法，然后再调用
        this.age = age;   //子类的构造方法
        this.color = color;//不能子类有构造方法父类没有

        //super(name,age,color);  //super()必须是构造方法的第一条语句

        //this(name,age,color)//构造方法中this(),super()不能同时出现

    }

    public void fly(){
        System.out.println(this.name + "飞");
    }
}

class Dog extends Animal{

    public Dog(String name, int age, String color) {
        super(name, age, color);
    }

    public void brak(){
        System.out.println(super.name + "叫");
    }
}

public class Main {
    public static void main(String[] args) {
        Dog d=new Dog("小黑",1,"黑");
        Bird b=new Bird("小白",2,"白");

    }
}